package Print;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;

public class MyPrintWrite {
    public static void main(String[] args) {
        try(PrintWriter printWriter = new PrintWriter(new FileWriter("D:\\software\\code\\2023_java\\2023_java_code\\code_24_4_26\\src\\Print\\TT",true))){
            printWriter.println(1);
            printWriter.println("你好鸭小鸭");
            printWriter.println("你好鸭小猫");
            printWriter.println("你好鸭小狗");
            printWriter.println();
            printWriter.println("A");
            printWriter.println('a');
            printWriter.println("你好鸭小板");

            //还支持字符输入流
            printWriter.write(98);
            printWriter.write("A");
            printWriter.write("你好鸭小童");
        }catch (IOException e){
            e.printStackTrace();
        }
    }
}
